unix `tee` - chain of commands

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-17T18:54:36Z Indexed on 2010/05/17 19:00 UTC
Read the original article Hit count: 243

Filed under:
|
|

In a unix environment, I want to use tee on a chain of commands like so

$ echo 1; echo 2 | tee file
1
2

$ cat file
2

Why does file only end up as having the output from the final command?

For the purpopses of this discussion, let's assume I can't break them apart and run the commands seperately.

© Stack Overflow or respective owner

Related posts about unix

Related posts about shell